//
//  WKFMDBTools.h
//  WeKeTang
//
//  Created by ichina on 2017/9/20.
//  Copyright © 2017年 Dezhi Tiancheng Education Technology (Beijing) Co. Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDB/FMDB.h>

@interface WKFMDBTools : NSObject

+ (instancetype)defaultFMDBToos;
//创建表格
-(void)creatTableDownload;
-(void)creatTableWatchRecode;
//插入数据
-(void)InsertDataWithVurl:(NSString *)vurl
                   Cgrade:(NSString*)cgrade
             section_name:(NSString*)section_name
           section_imgurl:(NSString*)section_imgurl
          section_videoid:(NSString*)section_videoid
                 courseid:(NSString*)courseid
                   stimes:(NSString*)stimes
                   status:(NSString*)status
        currentWatchCount:(NSString*)currentWatchCount
          totalWatchCount:(NSString*)totalWatchCount
            completeCount:(NSString*)completeCount
               totalCount:(NSString*)totalCount
               currentUrl:(NSString*)currentUrl;
#pragma mark - 插入观看数据
-(void)InsertWatchDataWithVurl:(NSString *)vurl
                        Cgrade:(NSString*)cgrade
                  section_name:(NSString*)section_name
                section_imgurl:(NSString*)section_imgurl
               section_videoid:(NSString*)section_videoid
                      courseid:(NSString*)courseid
                        stimes:(NSString*)stimes
                        status:(NSString*)status
                     totalTime:(NSString*)totalTime
                   currentTime:(NSString*)currentTime;
//查询数据
-(NSMutableArray*)QueryDataWithKey:(NSString*)key;
//根据状态查询数据
-(NSMutableArray*)QueryDataWithTableName:(NSString*)tableName Key:(NSString*)key;

-(NSString*)QueryWatchSeekTimeWithTableName:(NSString*)tableName
                            section_videoid:(NSString*)section_videoid;
#pragma mark - 查询观看记录
-(NSMutableArray*)QueryWatchDataWithKey:(NSString*)key;
//更新下载进度
-(void)UpdateDataWithTabelName:(NSString *)TabelName
                 completeCount:(NSString*)completeCount
               section_videoid:(NSString*)section_videoid;
//下载完成更新状态
-(void)UpdateDataWithTabelName:(NSString *)TabelName
                        status:(NSString*)status
               section_videoid:(NSString*)section_videoid;
#pragma mark - 更新播放记录数据
-(void)UpdateWatchDataWithTabelName:(NSString *)TabelName
                          vurl:(NSString*)vurl
                        cgrade:(NSString*)cgrade
                  section_name:(NSString*)section_name
                section_imgurl:(NSString*)section_imgurl
                      courseid:(NSString*)courseid
                        stimes:(NSString*)stimes
                        status:(NSString*)status
                     totalTime:(NSString*)totalTime
                   currentTime:(NSString*)currentTime
               section_videoid:(NSString*)section_videoid;
#pragma mark - 更新下载功能的播放
-(void)UpdateDownloadWatchDataWithTabelName:(NSString *)TabelName
                          currentWatchCount:(NSString*)currentWatchCount
                            totalWatchCount:(NSString*)totalWatchCount
                            section_videoid:(NSString*)section_videoid;
-(NSMutableArray*)QueryDataWithTableName:(NSString*)tableName
                         section_videoid:(NSString*)section_videoid;
#pragma mark - 查询下载未完成的数据
-(NSMutableArray*)QueryDownloadingDataWithTableName:(NSString*)tableName
                                             status:(NSString*)status;
#pragma mark - 查询播放数据
-(NSMutableArray*)QueryWatchDataWithTableName:(NSString*)tableName
                              section_videoid:(NSString*)section_videoid;
#pragma mark - 更新当前下载的url
-(void)UpdateDataWithTabelName:(NSString *)TabelName
                    currentUrl:(NSString*)currentUrl
               section_videoid:(NSString*)section_videoid;
#pragma mark - 删除下载视频
-(void)delegateDownLoadVideoWithTableName:(NSString*)tableName section_videoid:(NSString*)section_videoid;
#pragma mark - 删除观看数据
-(void)delegateWatchVideoWithTableName:(NSString*)tableName section_videoid:(NSString*)section_videoid;
@end
